package world.ztomorrow.novel.listen;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import world.ztomorrow.novel.dao.po.BookInfo;
import world.ztomorrow.novel.service.BookService;

import java.util.List;

@RestController
@RequiredArgsConstructor
public class PushListen {

    private final BookService bookService;

    @GetMapping("/rank")
    List<BookInfo> listRankBooks(@RequestParam("orderKey") String orderKey){
        return bookService.listRankBooks(orderKey);
    }

    @PostMapping("/books")
    List<BookInfo> listHomeBooks(@RequestBody List<Long> ids){
        return bookService.listHomeBooks(ids);
    }
}
